package io.geekidea.springbootplus.system.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import io.geekidea.springbootplus.framework.core.validator.groups.Add;
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;

@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "SysCategory对象", description = "商品分类")
public class SysCategory extends BaseEntity {

    private static final long serialVersionUID = 1L;
//`id``openid``nick_name``username``password``email``phone``integral``discount``balance`
// `description``card_number``avatar_url``gender``create_time`
    @ApiModelProperty("主键")
    @NotNull(message = "ID不能为空", groups = {Update.class})
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("分类名称")
    @NotNull(message = "分类名称不能为空", groups = {Add.class})
    private String name;

    @ApiModelProperty("父级编号")
    private Integer parentId;

    @ApiModelProperty("分类图标")
    private String iconUrl;

    @ApiModelProperty("分类级别")
    private Integer level;

}